package com.weilele.leisure.video_factory.ui.module.common.holder

import android.view.View
import com.weilele.leisure.time.databinding.HolderHomeToolsItemBinding
import com.weilele.mvvm.adapter.MvvmHolder
import com.weilele.mvvm.adapter.mvvmRcvAdapter
import com.weilele.mvvm.utils.activity.onClick

class HomeToolsItemHolder : MvvmHolder<HomeToolsItemHolder.Bean, HolderHomeToolsItemBinding> {
    companion object {
        fun toAdapter() = mvvmRcvAdapter(HomeToolsItemHolder::class.java)
    }

    constructor(binding: HolderHomeToolsItemBinding) : super(binding)
    constructor(itemView: View) : super(itemView)

    class Bean(
        var title: String,
        var onclick: Function1<View, Unit>?,
    )

    override fun bindData(data: Bean) {
        mBinding.root.onClick(null, data.onclick)
        mBinding.root.text = data.title
    }
}